<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Picture extends Model
{
    use HasFactory;

    public function getUrlAttribute($value)
    {
        if (strpos($value, 'http') !== false) {
            return $value;
        } else {
            return config('app.url') . $this->path;
        }
    }
}
